package com.tv.enoguia;

import java.util.ArrayList;

import com.google.android.gms.internal.fn;
import com.tv.enoguia.adapter.ListStepAdapter;
import com.tv.enoguia.bean.ObjRoute;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;

public class ShowDetailRouteActivity extends Activity {
	
	ListView listStep;
	ListStepAdapter adapter;
	ArrayList<String> objRoutes = new ArrayList<String>();
	TextView title, titleDistance;
	
	ImageButton btnBack;
	
	float distance;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_show_detail_route);
		
		objRoutes = getIntent().getStringArrayListExtra("route");
		distance = Float.parseFloat(getIntent().getStringExtra("distance"));
		
		title = (TextView) findViewById(R.id.title);
		
		titleDistance = (TextView) findViewById(R.id.title_distance);
		
		btnBack = (ImageButton) findViewById(R.id.btn_back);
		btnBack.setVisibility(View.VISIBLE);
		
		listStep = (ListView) findViewById(R.id.listRoute);
		adapter = new ListStepAdapter(ShowDetailRouteActivity.this, objRoutes);
		listStep.setAdapter(adapter);
		
		init();
	}
	
	void init(){
		title.setText(getString(R.string.direction));
		titleDistance.setText("Distancia "+distance+ " Km");
		btnBack.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}
}
